<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Our wedding</title>
<link href="jquery-mobile/jquery.mobile-1.0.min.css" rel="stylesheet" type="text/css"/>
<script src="jquery-mobile/jquery-1.6.4.min.js" type="text/javascript"></script>
<script src="jquery-mobile/jquery.mobile-1.0.min.js" type="text/javascript"></script>
<script src="jquery-mobile/jquerytimes-1.2.js" type="text/javascript"></script>
</head>
<script type="text/javascript">
function stringToTime(string) {
    var f = string.split(' ', 2);
    var d = (f[0] ? f[0] : '').split('-', 3);
    var t = (f[1] ? f[1] : '').split(':', 3);
    return (new Date(
   parseInt(d[0], 10) || null,
   (parseInt(d[1], 10) || 1) - 1,
parseInt(d[2], 10) || null,
parseInt(t[0], 10) || null,
parseInt(t[1], 10) || null,
parseInt(t[2], 10) || null
)).getTime();
}
function dateDiff(date1, date2) {
    var type1 = typeof date1, type2 = typeof date2;
    if (type1 == 'string')
        date1 = stringToTime(date1);
    else if (date1.getTime)
        date1 = date1.getTime();
    if (type2 == 'string')
        date2 = stringToTime(date2);
    else if (date2.getTime)
        date2 = date2.getTime();
    return (date2 - date1) / (1000 * 60 * 60 * 24); //结果是秒
}
function getmarryday(){
	var startdate = new Date();
	var enddate = '2012-12-1';
	
	var intervalday = dateDiff(startdate,stringToTime(enddate));
	//alert(intervalday);
	$("#marrydayspan").text(intervalday);
}
function onload()
{
	$('body').everyTime('1s',getmarryday);	
}
</script>
<body onLoad="onload()">
<div data-role="page" id="page">
  <div data-role="header" data-position="fixed">
    <h1>我们结婚啦!</h1>
  </div>
  <div data-role="content">
    <div> 还有 <span id="marrydayspan" style="font-size:large;font-family:'Arial Black', Gadget, sans-serif"></span> 天 </div>
    <p>2012年12月01日，新华光二楼华贵厅恭候光临。</p>
    <!--	
		<ul data-role="listview">
			<li><a href="#">婚纱照</a></li>
            <li><a href="#">婚宴</a></li>
			<li><a href="#">新房</a></li>
		</ul>
        --> 
  </div>
  <div data-role="footer" data-position="fixed">
    <h4>PJ & TJ Wedding 2012</h4>
    
  </div>
</div>
</body>
</html>
